using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class restart : MonoBehaviour
{
    public Material material_origin;
    // Start is called before the first frame update
    void Start()
    {
        material_origin = new Material(gameObject.transform.GetComponent<Renderer>().material);
        
    }

    // Update is called once per frame
    void Update()
    {

    }
    private void OnMouseDown()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
    private void OnMouseOver()
    //鼠标悬停时调用
    {
        gameObject.transform.GetComponent<Renderer>().material.color = Color.green;   
    }
    private void OnMouseExit()
    //鼠标退出时调用
    {
        gameObject.transform.GetComponent<Renderer>().material.color = material_origin.color;
    }
}
